Don't fail if we can't get a keyboard grab. (#168351)
authorMatthias Clasen <mclasen@redhat.com>
Wed, 20 Jul 2005 19:54:04 +0000 (19:54 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 20 Jul 2005 19:54:04 +0000 (19:54 +0000)
2005-07-20  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkdnd.c (gtk_drag_begin_internal): Don't fail if we
can't get a keyboard grab.  (#168351)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkdnd.c

index 3cf514dccdef7249e59650f0dc028f1eb976aa26..e770d165a2bd6d1e99a0e0102590520ee8bd28e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2005-07-20  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkdnd.c (gtk_drag_begin_internal): Don't fail if we
+       can't get a keyboard grab.  (#168351)
+
        * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_[sg]et_property):
        Add GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION. 
 
index 3cf514dccdef7249e59650f0dc028f1eb976aa26..e770d165a2bd6d1e99a0e0102590520ee8bd28e0 100644 (file)
@@ -1,5 +1,8 @@
 2005-07-20  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkdnd.c (gtk_drag_begin_internal): Don't fail if we
+       can't get a keyboard grab.  (#168351)
+
        * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_[sg]et_property):
        Add GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION. 
 
index 3cf514dccdef7249e59650f0dc028f1eb976aa26..e770d165a2bd6d1e99a0e0102590520ee8bd28e0 100644 (file)
@@ -1,5 +1,8 @@
 2005-07-20  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkdnd.c (gtk_drag_begin_internal): Don't fail if we
+       can't get a keyboard grab.  (#168351)
+
        * gtk/gtkfilechooserbutton.c (gtk_file_chooser_button_[sg]et_property):
        Add GTK_FILE_CHOOSER_PROP_DO_OVERWRITE_CONFIRMATION. 
 
index 4bd273939014f289c76439250c098d6ce6336f6d..ee0b8095b6be75a522c3cd7811617a49f838e5f9 100644 (file)
@@ -115,8 +115,7 @@ struct _GtkDragSourceInfo
   guint              destroy_icon : 1; /* If true, destroy icon_window
                                        */
   guint              have_grab : 1;    /* Do we still have the pointer grab
-
-                                        */
+                                       */
   GdkPixbuf         *icon_pixbuf;
   GdkCursor         *drag_cursors[6];
 };
@@ -2095,18 +2094,14 @@ gtk_drag_begin_internal (GtkWidget         *widget,
   if (gdk_pointer_grab (ipc_widget->window, FALSE,
                        GDK_POINTER_MOTION_MASK |
                        GDK_BUTTON_RELEASE_MASK, NULL,
-                       cursor, time) != 0)
-    {
-      gtk_drag_release_ipc_widget (ipc_widget);
-      return NULL;
-    }
-
-  if (gdk_keyboard_grab (ipc_widget->window, FALSE, time) != 0)
+                       cursor, time) != GDK_GRAB_SUCCESS)
     {
       gtk_drag_release_ipc_widget (ipc_widget);
       return NULL;
     }
 
+  gdk_keyboard_grab (ipc_widget->window, FALSE, time);
+    
   /* We use a GTK grab here to override any grabs that the widget
    * we are dragging from might have held
    */